load("//bzl:cpp_library.bzl", "cpp_library")

package(default_visibility = ["//visibility:public"])

cpp_library(
    name = "openssl_ptr_types",
    hdrs = ["OpenSSLPtrTypes.h"],
    deps = [
        "//folly:memory",
        "//folly/portability:openssl",
        "@glog",
    ],
)

cpp_library(
    name = "openssl_hash",
    srcs = ["OpenSSLHash.cpp"],
    hdrs = ["OpenSSLHash.h"],
    deps = [
        ":openssl_ptr_types",
        "//folly:exception",
        "//folly:format",
        "//folly:range",
        "//folly/io:iobuf",
        "//folly/portability:openssl",
    ],
)

cpp_library(
    name = "openssl_cert_utils",
    srcs = ["OpenSSLCertUtils.cpp"],
    hdrs = ["OpenSSLCertUtils.h"],
    deps = [
        ":openssl_ptr_types",
        "//folly:file_util",
        "//folly:optional",
        "//folly:scope_guard",
        "//folly:string",
        "//folly/io:iobuf",
        "//folly/portability:openssl",
    ],
)

cpp_library(
    name = "openssl_version_finder",
    hdrs = ["OpenSSLVersionFinder.h"],
    deps = [
        "//folly/portability:openssl",
    ],
)

cpp_library(
    name = "openssl_ticket_handler",
    hdrs = ["OpenSSLTicketHandler.h"],
    deps = [
        "//folly/portability:openssl",
    ],
)

cpp_library(
    name = "ssl_session",
    hdrs = ["SSLSession.h"],
)

cpp_library(
    name = "ssl_session_manager",
    srcs = ["SSLSessionManager.cpp"],
    hdrs = ["SSLSessionManager.h"],
    deps = [
        ":openssl_ptr_types",
        ":ssl_session",
        "//folly:overload",
        "//folly/portability:openssl",
        "//folly/ssl/detail:openssl_session",
    ],
)

cpp_library(
    name = "password_collector",
    srcs = ["PasswordCollector.cpp"],
    hdrs = ["PasswordCollector.h"],
)

cpp_library(
    name = "openssl_key_utils",
    srcs = ["OpenSSLKeyUtils.cpp"],
    hdrs = ["OpenSSLKeyUtils.h"],
    deps = [
        ":openssl_ptr_types",
        ":password_collector",
        "//folly:range",
        "//folly/portability:openssl",
    ],
)
